Skip to content

Conversation

@Dobrunia
Copy link
Member

Problem

When beforeSend returns a non-object (e.g. true, undefined, or omits return), that value was used as payload and sent to the collector. The backend then stored it as-is (e.g. payload: true in MongoDB), which led to:

  • GraphQL: Cannot return null for non-nullable field EventPayload.title
  • Frontend: TypeError: can't access property "event", l is null on project overview

Common mistakes:

  • beforeSend: (e) => true (meant “allow”, but overwrites payload)
  • beforeSend: (e) => { console.log(e); } (no return → undefined as payload)

Solution

Validate the return value of beforeSend and only use it when it’s a valid event object:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants